<?php

use Illuminate\Database\Seeder;

class UsersSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // DB::table('users')->insert([
        //     'username' => str_random(10),
        //     'email' => str_random(10).'@gmail.com',
        //     'password' => bcrypt('secret'),
        //     'img' => '/uploads/149792840535889.jpg',
        // ]);
        $data = [];

        for($i=0;$i<100;$i++) {
        	$tmp = [];
        	$tmp['username'] = str_random(10);
        	$tmp['password'] = Hash::make('lamp179');
        	$tmp['email'] = rand(100000,999999).'@qq.com';// str_random(10).'@163.com'
        	// $tmp['age'] = rand(10,20);// str_random(10).'@163.com'
        	$tmp['img'] = '/uploads/149792840535889.jpg';// str_random(10).'@163.com'

        	$data[] = $tmp;
        }

        DB::table('users')->insert($data);
    }
}
